﻿#if No_No_no_Error
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class AudioManager : MonoBehaviour
{

	public AudioSource characterSound, mainMusic;

	public AudioClip starHitSound, levelCompleteSfx, clickSound;

	public static AudioManager Instance { get { return instance; } }

	private static AudioManager instance;


	void Awake ()
	{
		if (instance == null) {
			instance = this;
			DontDestroyOnLoad (this.gameObject);
		} 
        
	}

	public void PlayStarHit()
	{
		characterSound.PlayOneShot (starHitSound, 1.0f);
	}
	public void PlayLevelComplete()
	{
		characterSound.PlayOneShot (levelCompleteSfx, 1.0f);
	}

	public void PlayClickSound()
	{
		characterSound.PlayOneShot (clickSound, 1.0f);
	}

	public void ToggleMusic(int _toggle)
	{
		if (_toggle == 0)
			mainMusic.mute = true;
		else
			mainMusic.mute = false;
	}
	public void ToggleSound(int _toggle)
	{
		if (_toggle == 0)
			characterSound.mute = true;
		else
			characterSound.mute = false;
	}

}
#endif